package com.sirun.cn.fca.service;

import android.content.Context;

import com.tencent.tac.TACApplication;
import com.tencent.tac.analytics.TACAnalyticsOptions;
import com.tencent.tac.analytics.TACAnalyticsService;
import com.tencent.tac.analytics.TACAnalyticsStrategy;
import com.tencent.tac.option.TACApplicationOptions;

/**
 * 数据分析
 *
 * @author showxiao
 * @date 2018/4/20
 */

public class AnalyticsService {

    public static void init(Context context) {
        TACApplicationOptions applicationOptions = TACApplication.options();
        TACAnalyticsOptions analyticsOptions = applicationOptions.sub("analytics");
        analyticsOptions.strategy(true
                ? TACAnalyticsStrategy.INSTANT      // 实时上报
                : TACAnalyticsStrategy.PERIOD);     // 批量上报
        // 启动 analytics 服务（腾讯移动分析）
        TACAnalyticsService.getInstance().start(context);
    }
}
